/**
 * VUEshop
 * ============================================================================
 * * 版权所有 2015-2027 深圳搜豹网络科技有限公司，并保留所有权利。
 * 网站地址: http://www.vueshop.com.cn
 * ----------------------------------------------------------------------------
 * 这不是一个自由软件！您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
 * 不允许对程序代码以任何形式任何目的的再发布。
 * ============================================================================
 * $Author: soubao-java 2020-07-22 $
 */<template>
  <div class="page">
    <div class="fixed-bar">
      <div class="item-title">
        <router-link
          class="back"
          :to="{name:'stores',params:{currentPage:$route.params.currentPage}}"
          title="返回列表"
        >
          <i class="fa fa-arrow-circle-o-left"></i>
        </router-link>
        <div class="subject">
          <h3>店铺管理 - 查看会员 <{{storeApply.seller_name}}> 的店铺注册信息</h3>
          <h5>店铺的审核续费及经营类目结算周期操作</h5>
        </div>
      </div>
    </div>
    <table class="store-joinin" cellspacing="0" cellpadding="0" border="0">
      <thead>
        <tr>
          <th colspan="20">公司及联系人信息</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th class>公司名称：</th>
          <td>{{storeApply.company_name}}</td>
          <th>公司网址：</th>
          <td colspan="20">{{storeApply.company_website}}</td>
        </tr>
        <tr>
          <th>公司所在地：</th>
          <td>{{storeApply.province_name}} {{storeApply.city_name}} {{storeApply.district_name}}</td>
          <th>公司详细地址：</th>
          <td>{{storeApply.company_address}}</td>
          <th>固定电话：</th>
          <td>{{storeApply.company_telephone}}</td>
        </tr>
        <tr>
          <th>邮政编码：</th>
          <td>{{storeApply.company_zipcode}}</td>
          <th>电子邮箱：</th>
          <td>{{storeApply.company_email}}</td>
          <th>传真：</th>
          <td>{{storeApply.company_fax}}</td>
        </tr>
        <tr>
          <th>联系人姓名：</th>
          <td>{{storeApply.contacts_name}}</td>
          <th>联系人电话：</th>
          <td>{{storeApply.contacts_mobile}}</td>
          <th>联系人邮箱：</th>
          <td>{{storeApply.contacts_email}}</td>
        </tr>
      </tbody>
    </table>
    <table class="store-joinin" cellspacing="0" cellpadding="0" border="0">
      <thead>
        <tr>
          <th colspan="20">营业执照信息（副本）</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th>营业执照号：</th>
          <td>{{storeApply.business_licence_number}}</td>
          <th>营业执照有效期：</th>
          <td
            v-if="storeApply.business_date_end"
          >{{storeApply.business_date_start}}-{{storeApply.business_date_end}}</td>
          <td v-else>长期</td>
          <th>法定经营范围：</th>
          <td>{{storeApply.business_scope}}</td>
        </tr>
        <tr>
          <th>注册资本：</th>
          <td>{{storeApply.reg_capital}}</td>
          <th>组织机构代码：</th>
          <td>{{storeApply.orgnization_code}}</td>
        </tr>
        <tr>
          <th>法人代表姓名：</th>
          <td>{{storeApply.legal_person}}</td>
          <th>纳税类型税码：</th>
          <td>{{storeApply.tax_rate}}%</td>
          <th>税务登记号码：</th>
          <td>{{storeApply.attached_tax_number}}</td>
        </tr>
      </tbody>
    </table>
    <table class="store-joinin" cellspacing="0" cellpadding="0" border="0">
      <thead>
        <tr>
          <th colspan="20">开户银行信息：</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th class="w150">银行开户名：</th>
          <td>{{storeApply.bank_account_name}}</td>
        </tr>
        <tr>
          <th>公司银行账号：</th>
          <td>{{storeApply.bank_account_number}}</td>
        </tr>
        <tr>
          <th>开户银行支行名称：</th>
          <td>{{storeApply.bank_branch_name}}</td>
        </tr>
        <tr>
          <th>开户银行所在地：</th>
          <td colspan="20">{{storeApply.bank_province_name}} {{storeApply.bank_city_name}}</td>
        </tr>
      </tbody>
    </table>

    <table class="store-joinin" cellspacing="0" cellpadding="0" border="0">
      <thead>
        <tr>
          <th colspan="20">店铺经营信息</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th class="w150">卖家账号：</th>
          <td>{{storeApply.seller_name}}</td>
        </tr>
        <tr>
          <th class="w150">店铺名称：</th>
          <td>{{storeApply.store_name}}</td>
        </tr>
        <tr>
          <th>店铺等级：</th>
          <td>
            <span
              v-if="storeGrade"
            >{{storeGrade.sg_name}}（开店费用：{{storeGrade.sg_price | toFixed}} 元/年）</span>
          </td>
        </tr>
        <tr>
          <th class="w150">店铺负责人：</th>
          <td>{{storeApply.store_person_name}}</td>
        </tr>
        <tr>
          <th>负责人手机号码：</th>
          <td>{{storeApply.store_person_mobile}}</td>
        </tr>
        <tr>
          <th>负责人QQ号码：</th>
          <td>{{storeApply.store_person_qq}}</td>
        </tr>
        <tr>
          <th>负责人邮箱：</th>
          <td>{{storeApply.store_person_email}}</td>
        </tr>
        <tr>
          <th>店铺分类：</th>
          <td>{{storeApply.sc_name}}</td>
        </tr>
        <tr>
          <th>经营类目：</th>
          <td colspan="2">
            <table
              id="table_category"
              class="type"
              cellspacing="0"
              cellpadding="0"
              border="0"
              v-if="storeBindClasses"
            >
              <thead>
                <tr>
                  <th>分类1</th>
                  <th>分类2</th>
                  <th>分类3</th>
                  <th>比例</th>
                </tr>
              </thead>
              <tbody>
                <tr v-for="sbc in storeBindClasses">
                  <td>{{sbc.class_one_name}}</td>
                  <td>{{sbc.class_two_name}}</td>
                  <td>{{sbc.class_three_name}}</td>
                  <td>{{sbc.commis_rate}}%</td>
                </tr>
              </tbody>
            </table>
          </td>
        </tr>
      </tbody>
    </table>

    <table class="store-joinin" cellspacing="0" cellpadding="0" border="0">
      <thead>
        <tr>
          <th colspan="20">证件信息：</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <th>企业营业执照副本：</th>
          <td colspan="20">
            <!-- <a nctype="nyroModal" target="_blank" :href="storeApply.business_licence_cert">
              <img :src="storeApply.business_licence_cert" />
            </a>-->
            <el-image
              style="width: 100px; height: 100px"
              :src="storeApply.business_licence_cert"
              :preview-src-list="[storeApply.business_licence_cert]"
            ></el-image>
          </td>
        </tr>
        <tr>
          <th>税务登记证复印件：</th>
          <td colspan="20">
            <!-- <a nctype="nyroModal" target="_blank" :href="storeApply.taxpayer_cert">
              <img :src="storeApply.taxpayer_cert" />
            </a>-->
            <el-image
              style="width: 100px; height: 100px"
              :src="storeApply.taxpayer_cert"
              :preview-src-list="[storeApply.taxpayer_cert]"
            ></el-image>
          </td>
        </tr>
        <tr>
          <th>织机构代码证复印件：</th>
          <td colspan="20">
            <!-- <a nctype="nyroModal" target="_blank" :href="storeApply.orgnization_cert">
              <img :src="storeApply.orgnization_cert" />
            </a>-->
            <el-image
              style="width: 100px; height: 100px"
              :src="storeApply.orgnization_cert"
              :preview-src-list="[storeApply.orgnization_cert]"
            ></el-image>
          </td>
        </tr>
        <tr>
          <th>法人身份证：</th>
          <td colspan="20">
            <!-- <a nctype="nyroModal" target="_blank" :href="storeApply.legal_identity_cert">
              <img :src="storeApply.legal_identity_cert" />
            </a>-->
            <el-image
              style="width: 100px; height: 100px"
              :src="storeApply.legal_identity_cert"
              :preview-src-list="[storeApply.legal_identity_cert]"
            ></el-image>
          </td>
        </tr>
        <tr>
          <th>店铺负责人身份证：</th>
          <td colspan="20">
            <!-- <a nctype="nyroModal" target="_blank" :href="storeApply.store_person_cert">
              <img :src="storeApply.store_person_cert" />
            </a>-->
            <el-image
              style="width: 100px; height: 100px"
              :src="storeApply.store_person_cert"
              :preview-src-list="[storeApply.store_person_cert]"
            ></el-image>
          </td>
        </tr>
      </tbody>
    </table>
  </div>
</template>

<script>
export default {
  data() {
    return {
      currentPage: this.$route.params.currentPage || 1,
      userId: this.$route.params.userId,
      sgId: this.$route.params.sgId,
      storeId: this.$route.params.storeId,
      storeApply: {
        seller_name: ""
      },
      storeGrade: null,
      storeBindClasses: null
    };
  },
  created() {
    this.getStoreApply();
    this.getStoreGrade();
    this.getStoreBindClass();
  },
  methods: {
    getStoreApply() {
      var that = this;
      this.request
        .get("/seller/store_apply", {
          params: {
            user_id: that.userId
          }
        })
        .then(function(res) {
          that.storeApply = res;
        });
    },
    getStoreGrade() {
      var that = this;
      this.request
        .get("/seller/store_grade?sg_id=" + this.sgId)
        .then(function(res) {
          that.storeGrade = res;
        });
    },
    getStoreBindClass() {
      var that = this;
      this.request
        .get("/seller/store_bind_class/list", {
          params: { store_id: that.storeId }
        })
        .then(function(res) {
          that.storeBindClasses = res;
        });
    }
  },
  filters: {
    toFixed(value) {
      if (typeof value == "number") {
        return value.toFixed(2);
      } else {
        return value;
      }
    }
  }
};
</script>

<style scoped>
.ncap-order-style .ncap-order-details {
  margin: 20px auto;
}
</style>
